package gewu.suleju.controller;

import gewu.suleju.model.vo.Result;
import gewu.suleju.sevice.imp.BrokerAgentHousServiceImp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Map;
@Controller
@RequestMapping("agent")
public class BrokerAgentHouseController {
    @Autowired
    BrokerAgentHousServiceImp brokerAgent;
    @ResponseBody
    @GetMapping("agenting")
    public Result agentIng(String brokerid){
        int brokerId=Integer.parseInt(brokerid);
        System.out.println(brokerid);
        Map  brokerAgents=brokerAgent.brokerAgentIng(brokerId);
        return new Result("200","未出租的房子",brokerAgents);
    }
    @ResponseBody
    @GetMapping("agentend")
    public Result agentEnd(String brokerid){
        int brokerId=Integer.parseInt(brokerid);
        System.out.println(brokerid);
        Map  brokerAgents=brokerAgent.brokerAgentEnd(brokerId);
        return new Result("200","已经出租出租的房子",brokerAgents);
    }

}
